home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / chatsrvr / clntsock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  1.7 KB  |  72 lines

  1. // clntsock.h : interface of the CClientSocket class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef __CLNTSOCK_H__
  14. #define __CLNTSOCK_H__
  15.  
  16. class CMsg;
  17. class CServerDoc;
  18.  
  19. #if defined(_WIN32_WCE)
  20. class CClientSocket : public CCeSocket
  21. #else // _WIN32_WCE
  22. class CClientSocket : public CSocket
  23. #endif // _WIN32_WCE
  24. {
  25.     DECLARE_DYNAMIC(CClientSocket);
  26. private:
  27.     CClientSocket(const CClientSocket& rSrc);         // no implementation
  28.     void operator=(const CClientSocket& rSrc);  // no implementation
  29.  
  30. // Construction
  31. public:
  32. #if defined(_WIN32_WCE)
  33.     CClientSocket(CServerDoc* pDoc, PURPOSE_E iPurpose=FOR_DATA);
  34. #else // _WIN32_WCE
  35.     CClientSocket(CServerDoc* m_pDoc);
  36. #endif // _WIN32_WCE
  37.  
  38. // Attributes
  39. public:
  40.     int m_nMsgCount;
  41.     CSocketFile* m_pFile;
  42.     CArchive* m_pArchiveIn;
  43.     CArchive* m_pArchiveOut;
  44.     CServerDoc* m_pDoc;
  45.     BOOL IsAborted() { return m_pArchiveOut == NULL; }
  46.  
  47. // Operations
  48. public:
  49.     void Init();
  50.     void Abort();
  51.     void SendMsg(CMsg* pMsg);
  52.     void ReceiveMsg(CMsg* pMsg);
  53.  
  54. // Overridable callbacks
  55. protected:
  56.     virtual void OnReceive(int nErrorCode);
  57. #if defined(_WIN32_WCE)
  58.     virtual void OnClose(int nErrorCode);
  59. #endif // _WIN32_WCE
  60.  
  61. // Implementation
  62. public:
  63.     virtual ~CClientSocket();
  64.  
  65. #ifdef _DEBUG
  66.     virtual void AssertValid() const;
  67.     virtual void Dump(CDumpContext& dc) const;
  68. #endif
  69. };
  70.  
  71. #endif // __CLNTSOCK_H__
  72.